#!/usr/bin/python
#coding: UTF-8

import pymysql
from Config.Config import conn

class GetProxies(object):

    def __init__(self):
        self.conn = conn
        self.conn.select_db("kuaidaili")
        self.select_sql = "select url from kuaiIP;"

    def getIPUrl(self):
        self.cur = self.conn.cursor()
        self.cur.execute(self.select_sql)
        urls = self.cur.fetchall()

        results = []
        for u in urls:
            # print u
            results.append(dict({"http" : u[0], "https" : u[0]}))

        return results

if __name__ == "__main__":
    g = GetProxies()
    print g.getIPUrl()